package com.jinzhi.api.controller.aunt;

import com.jinzhi.common.utils.Result;
import com.jinzhi.jzweb.domain.JazShippingAddressDO;
import com.jinzhi.jzweb.domain.JazUserHouseDO;
import com.jinzhi.jzweb.service.JazShippingAddressService;
import com.jinzhi.jzweb.service.JazUserHouseService;
import io.swagger.annotations.*;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: mcf
 * @CreateTime: 2024/05/16
 * @Description: 住宿管理 Controller
 */
@Controller
@RequestMapping("/api/auntHouse")
@Api(value = "阿姨端住宿管理", tags = "阿姨端住宿管理")
public class AuntHouseController {

    private final JazUserHouseService jazUserHouseService;

    public AuntHouseController(JazUserHouseService jazUserHouseService){
        this.jazUserHouseService = jazUserHouseService;

    }

    @ApiOperation(value = "预约住宿", notes = "预约住宿")
    @ApiImplicitParams({
    })
    @ApiResponses({@ApiResponse(code = 0, message = "操作成功",response = JazUserHouseDO.class),
            @ApiResponse(code = 500, message = "服务器内部异常")})
    @ResponseBody
    @PostMapping("/subscribeHouse")
    public Result<?> subscribeHouse(@RequestBody JazUserHouseDO jazUserHouseDO){

        return jazUserHouseService.auntSubscribeHouse(jazUserHouseDO);
    }



    @ApiOperation(value = "阿姨预约入住详情", notes = "阿姨预约入住详情")
    @ApiImplicitParams({
    })
    @ApiResponses({@ApiResponse(code = 0, message = "操作成功",response = JazUserHouseDO.class),
            @ApiResponse(code = 500, message = "服务器内部异常")})
    @GetMapping("/auntGetHouse")
    @ResponseBody
    public Result<?> subscribeHouse(){

        return Result.ok(jazUserHouseService.auntGetHouse());
    }





}
